package day10.homework3;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) throws Exception {
        Scanner input = new Scanner(System.in);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        System.out.print("请输入日期：");
        String dateStr = input.next();
        Date date = sdf.parse(dateStr);
        Calendar instance = Calendar.getInstance();
        instance.setTime(date);
        instance.add(Calendar.YEAR, 1);
        System.out.println(sdf.format(instance.getTime()));
//        long yearMillionTime = 3600L * 1000 * 24 * 365;
//        System.out.println(sdf.format(new Date(date.getTime() + yearMillionTime)));
    }
}
